require 'rho/rhocontroller'
require 'helpers/browser_helper'

class HelpController < Rho::RhoController
  include BrowserHelper

  #GET /Help
  def index
    @helps = Help.find(:all)
    render
  end

  # GET /Help/{1}
  def show
    @help = Help.find(@params['id'])
    if @help
      render :action => :show
    else
      redirect :action => :index
    end
  end

  # GET /Help/new
  def new
    @help = Help.new
    render :action => :new
  end

  # GET /Help/{1}/edit
  def edit
    @help = Help.find(@params['id'])
    if @help
      render :action => :edit
    else
      redirect :action => :index
    end
  end

  # POST /Help/create
  def create
    @help = Help.create(@params['help'])
    redirect :action => :index
  end

  # POST /Help/{1}/update
  def update
    @help = Help.find(@params['id'])
    @help.update_attributes(@params['help']) if @help
    redirect :action => :index
  end

  # POST /Help/{1}/delete
  def delete
    @help = Help.find(@params['id'])
    @help.destroy if @help
    redirect :action => :index
  end
end
